home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / E-G / Externals.cpt / Externals / card_9227.txt < prev    next >
Text File  |  1989-02-26  |  8KB  |  316 lines

  1. -- card: 9227 from stack: in
  2. -- bmap block id: 9607
  3. -- flags: 0000
  4. -- background id: 8891
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on mouseUp
  8.   hide card field "info"
  9. end mouseUp
  10.  
  11. on openCard
  12.   global match
  13.   global source
  14.   set the scroll of card field "names" to 0
  15.   put empty into source
  16.   hide card field "info"
  17.   set the hilite of button "Match exact" to true
  18.   put empty into match
  19. end openCard
  20.  
  21.  
  22. -- part 1 (button)
  23. -- low flags: 00
  24. -- high flags: A003
  25. -- rect: left=207 top=311 right=333 bottom=307
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 0 / 0
  28. -- text alignment: 1
  29. -- font id: 0
  30. -- text size: 12
  31. -- style flags: 0
  32. -- line height: 16
  33. -- part name: Go Back
  34. ----- HyperTalk script -----
  35. on mouseUp
  36.   set the scroll of card field "names" to 0
  37.   set the hilite of button "hiliteRegion" to false
  38.   put empty into card field "lineF"
  39.   put empty into card field "itemF"
  40.   put empty into card field "searchF"
  41.   visual effect iris close
  42.   go to card id 8200
  43. end mouseUp
  44.  
  45.  
  46.  
  47. -- part 2 (field)
  48. -- low flags: 01
  49. -- high flags: 0000
  50. -- rect: left=161 top=33 right=56 bottom=375
  51. -- title width / last selected line: 0
  52. -- icon id / first selected line: 0 / 0
  53. -- text alignment: 1
  54. -- font id: 2
  55. -- text size: 18
  56. -- style flags: 0
  57. -- line height: 24
  58. -- part name: 
  59.  
  60.  
  61. -- part 3 (field)
  62. -- low flags: 01
  63. -- high flags: 2007
  64. -- rect: left=128 top=87 right=187 bottom=401
  65. -- title width / last selected line: 0
  66. -- icon id / first selected line: 0 / 0
  67. -- text alignment: 0
  68. -- font id: 3
  69. -- text size: 12
  70. -- style flags: 0
  71. -- line height: 16
  72. -- part name: names
  73.  
  74.  
  75. -- part 4 (button)
  76. -- low flags: 00
  77. -- high flags: A003
  78. -- rect: left=143 top=201 right=223 bottom=243
  79. -- title width / last selected line: 0
  80. -- icon id / first selected line: 0 / 0
  81. -- text alignment: 1
  82. -- font id: 0
  83. -- text size: 12
  84. -- style flags: 0
  85. -- line height: 16
  86. -- part name: Find...
  87. ----- HyperTalk script -----
  88. on mouseUp
  89.   global source
  90.   global lastPos
  91.   global match
  92.   put empty into card field "searchF"
  93.   set the scroll of card field "names" to 0
  94.   set the hilite of button "hiliteRegion" to false
  95.   ask "Find what state or capitol?" with source
  96.   if it is not empty then
  97.     put it into source
  98.     put find( card field "names", match & source ) into lastPos
  99.     if item 1 of lastPos=0 then
  100.       put empty into card field "lineF"
  101.       put empty into card field "itemF"
  102.       put "Search string not found" into card field "searchF"
  103.       set the hilite of button "hiliteRegion" to false
  104.     else
  105.       put "Line"&&item 1 of lastPos into card field "lineF"
  106.       put "Item"&&item 2 of lastPos into card field "itemF"
  107.       put "Search string found in:" into card field "searchF"
  108.       put (the textHeight of card field "names")* (item 1 of lastPos - 1) into scrollAmount
  109.       set the scroll of card field "names" to scrollAmount
  110.       set the hilite of button "hiliteRegion" to true
  111.     end if
  112.   end if
  113. end mouseUp
  114.  
  115.  
  116.  
  117. -- part 12 (field)
  118. -- low flags: 01
  119. -- high flags: 2002
  120. -- rect: left=270 top=265 right=287 bottom=329
  121. -- title width / last selected line: 0
  122. -- icon id / first selected line: 0 / 0
  123. -- text alignment: 0
  124. -- font id: 3
  125. -- text size: 10
  126. -- style flags: 0
  127. -- line height: 13
  128. -- part name: lineF
  129.  
  130.  
  131. -- part 13 (field)
  132. -- low flags: 01
  133. -- high flags: 2002
  134. -- rect: left=357 top=265 right=287 bottom=413
  135. -- title width / last selected line: 0
  136. -- icon id / first selected line: 0 / 0
  137. -- text alignment: 0
  138. -- font id: 3
  139. -- text size: 10
  140. -- style flags: 0
  141. -- line height: 13
  142. -- part name: itemF
  143.  
  144.  
  145. -- part 14 (field)
  146. -- low flags: 01
  147. -- high flags: 2002
  148. -- rect: left=111 top=265 right=287 bottom=240
  149. -- title width / last selected line: 0
  150. -- icon id / first selected line: 0 / 0
  151. -- text alignment: 0
  152. -- font id: 3
  153. -- text size: 10
  154. -- style flags: 0
  155. -- line height: 13
  156. -- part name: searchF
  157.  
  158.  
  159. -- part 20 (button)
  160. -- low flags: 00
  161. -- high flags: 0000
  162. -- rect: left=129 top=88 right=109 bottom=384
  163. -- title width / last selected line: 0
  164. -- icon id / first selected line: 0 / 0
  165. -- text alignment: 1
  166. -- font id: 0
  167. -- text size: 12
  168. -- style flags: 0
  169. -- line height: 16
  170. -- part name: hiliteRegion
  171.  
  172.  
  173. -- part 21 (button)
  174. -- low flags: 00
  175. -- high flags: A003
  176. -- rect: left=143 top=228 right=250 bottom=243
  177. -- title width / last selected line: 0
  178. -- icon id / first selected line: 0 / 0
  179. -- text alignment: 1
  180. -- font id: 0
  181. -- text size: 12
  182. -- style flags: 0
  183. -- line height: 16
  184. -- part name: Find Next
  185. ----- HyperTalk script -----
  186. on mouseUp
  187.   global lastPos
  188.   global source
  189.   global match
  190.   put empty into card field "searchF"
  191.   put find( card field "names", match & source, item 1 of lastPos, item 2 of lastPos ) into lastPos
  192.   if item 1 of lastPos=0 then
  193.     put empty into card field "lineF"
  194.     put empty into card field "itemF"
  195.     put "Search string not found" into card field "searchF"
  196.     set the hilite of button "hiliteRegion" to false
  197.   else
  198.     put "Line"&&item 1 of lastPos into card field "lineF"
  199.     put "Item"&&item 2 of lastPos into card field "itemF"
  200.     put "Search string found in:" into card field "searchF"
  201.     put (the textHeight of card field "names")* (item 1 of lastPos - 1) into scrollAmount
  202.     set the scroll of card field "names" to scrollAmount
  203.     set the hilite of button "hiliteRegion" to true
  204.   end if
  205. end mouseUp
  206.  
  207.  
  208.  
  209. -- part 24 (button)
  210. -- low flags: 00
  211. -- high flags: E005
  212. -- rect: left=267 top=218 right=238 bottom=377
  213. -- title width / last selected line: 0
  214. -- icon id / first selected line: 0 / 0
  215. -- text alignment: 1
  216. -- font id: 0
  217. -- text size: 12
  218. -- style flags: 0
  219. -- line height: 16
  220. -- part name: Match exact
  221. ----- HyperTalk script -----
  222. on mouseUp
  223.   global match
  224.   if the hilite of button "Match exact" then
  225.     put empty into match
  226.   else
  227.     put "<" into match
  228.   end if
  229. end mouseUp
  230.  
  231.  
  232.  
  233. -- part 23 (field)
  234. -- low flags: 81
  235. -- high flags: 2002
  236. -- rect: left=50 top=71 right=338 bottom=468
  237. -- title width / last selected line: 0
  238. -- icon id / first selected line: 0 / 0
  239. -- text alignment: 0
  240. -- font id: 3
  241. -- text size: 12
  242. -- style flags: 0
  243. -- line height: 16
  244. -- part name: info
  245.  
  246.  
  247. -- part contents for card part 2
  248. ----- text -----
  249. Find Demo
  250.  
  251. -- part contents for card part 3
  252. ----- text -----
  253. Montgomery,Alabama,AL
  254. Juneau,Alaska,
  255. Pheonix,Arizona,AZ
  256. Little Rock,Arkansas,
  257. Sacramento,California,CA
  258. Denver,Colorado,CO
  259. Hartford,Connecticut,CT
  260. Dover,Delaware,DE
  261. District of Columbia,Washington,DC
  262. Tallahassee,Florida,FL
  263. Atlanta,Georgia,GA
  264. Honolulu,Hawaii,HI
  265. Boise,Idaho,ID
  266. Springfield,Illinois,IL
  267. Indianapolis,Indiana,IN
  268. Des Moines,Iowa
  269. Topeka,Kansas,KS
  270. Frankfort,Kentucky,KY
  271. Baton Rouge,Lousiana,LA
  272. Augusta,Maine,ME
  273. Annapolis,Maryland,MD
  274. Boston,Massachusetts,MA
  275. Lansing,Michigan,MI
  276. St. Paul,Minnesota,MN
  277. Jackson,Mississippi,MS
  278. Jefferson City,Missouri,MO
  279. Helena,Montana,MT
  280. Lincoln,Nebraska,NE
  281. Carson City,Nevada,NV
  282. Concord,New Hampshire,NH
  283. Trenton,New Jersey,NJ
  284. Albany,New York,NY
  285. Raleigh,North Carolina,NC
  286. Bismarck,North Dakota,ND
  287. Columbus,Ohio,OH
  288. Oklahoma City,Oklahoma,OK
  289. Salem,Oregon,OR
  290. Harrisburg,Pennsylvania,PA
  291. Providence,Rhode Island,RI
  292. Columbia,South Carolina,SC
  293. Pierre,South Dakota,SD
  294. Nashville,Tennessee,TN
  295. Austin,Texas,TX
  296. Salt Lake City,Utah,UT
  297. Montpelier,Vermont,VT
  298. Richmond,Virginia,VA
  299. Olympia,Washington,WA
  300. Charleston,West Virginia,WV
  301. Madison,Wisconsin,WI
  302. Cheyene,Wyoming,WY
  303.  
  304. -- part contents for card part 23
  305. ----- text -----
  306. The syntax for the find command is:
  307.  
  308. position = FIND( target, source [ ,afterLine [ ,afterItem ] ] )
  309.  
  310. The target is any container through which you want to search.
  311. The source is any container, variable or string for which you ¬†¬†want to search. If the source string begins with the ‚Äú<‚Äù ¬†¬†character then the search is for any match of the source in ¬†¬†the target. (The ‚Äú<‚Äù character is not treated as part of the ¬†¬†string.) Otherwise, the search is for an exact match of the ¬†¬†source with an item in the target.
  312. The afterLine is an optional parameter specifying the line after ¬†¬†which to begin searching.
  313. The afterItem is an optional parameter specifying the item ¬†¬†after which to begin searching.
  314.  
  315.  
  316.